The source code for the on-screen keyboard is available at:
http://portableapps.com/OSKPortable